import {legacy_createStore as createStore,applyMiddleware} from 'redux';
import createSagaMiddleware from 'redux-saga'
//执行此工厂函数会返回saga中间件
const sagaMiddleware = createSagaMiddleware();
import rootSaga from './rootSaga';
import reducer from './reducer';
//应用saga中间件帮我们创建仓库
const store = applyMiddleware(sagaMiddleware)(createStore)(reducer);
//使用中间的run方法来启动此rootSaga
sagaMiddleware.run(rootSaga);
export default store;
//runSaga